<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Wiki template handling</title>
</head>
<body style="font-family:sans-serif">

<p><a href="index.html">Overpass API</a> &gt;</p>

<h1>Wiki template handling</h1>

<p>The template Wiki mechanism of Overpass API works as follows: A wiki page only needs to call a <a href="https://wiki.openstreetmap.org/wiki/Overpass_API/Permanent_ID">link encapsulation template</a>. That expands into the longer link to query an Overpass API <a href="output_formats.html#custom">custom output page</a>. Normally, we are done here with a redirection or disambiguation page. But sometimes you want to get a custom formatted disambiguation page. How to write such a page is explained on the <a href="output_formats.html#custom">custom output page</a>. We explain here how to get a template onto the Overpass API server.</p>

<p>To avoid that arbritrary files can be stored at the Overpass API server, it only fetches files from the <a href="https://wiki.openstreetmap.org/">OpenStreetMap wiki</a>, and only pages beginning with &quot;Template:&quot;. Thus, you need to store your template in the OpenStreetMap wiki and then to let Overpass API load that template.</p>

<p>Overpass API doesn't poll the wiki server without explicit order. To fetch a template named e.g. &quot;Template:Foobar&quot; from the wiki onto the Overpass API server, call</p>
<pre>
https://overpass-api.de/api/template?action=<strong>fetch</strong>&amp;name=<strong>Template:Foobar</strong>
</pre>
<p>To check if the template has been successfully fetched or to see what the server has stored for an existing template, call</p>
<pre>
https://overpass-api.de/api/template?action=<strong>show</strong>&amp;name=<strong>Template:Foobar</strong>
</pre>

</body>
</html>
